package com.tao.auto.batchtao.database.entity;


import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "MGT_USER_INFO", schema = "myproject", catalog = "")
public class MgtUserInfo {

  private long id;
  private String username;
  private String password;
  private long number;
  private long invitationCode;
  private long fatherInvitationCode;
  private String sign;
  private String registerTime;
  private String signTime;

  @Id
  @Column(name = "id", nullable = false)
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  public long getId() {
    return id;
  }

  public void setId(long id) {
    this.id = id;
  }

  @Basic
  @Column(name = "username", nullable = false, length = 20)
  public String getUsername() {
    return username;
  }

  public void setUsername(String username) {
    this.username = username;
  }

  @Basic
  @Column(name = "password", nullable = false, length = 20)
  public String getPassword() {
    return password;
  }

  public void setPassword(String password) {
    this.password = password;
  }

  @Basic
  @Column(name = "number", nullable = false)
  public long getNumber() {
    return number;
  }


  public void setNumber(long number) {
    this.number = number;
  }

  @Basic
  @Column(name = "invitationCode", nullable = false)
  public long getInvitationCode() {
    return invitationCode;
  }


  public void setInvitationCode(long invitationCode) {
    this.invitationCode = invitationCode;
  }

  @Basic
  @Column(name = "fatherInvitationCode", nullable = false)
  public long getFatherInvitationCode() {
    return fatherInvitationCode;
  }


  public void setFatherInvitationCode(long fatherInvitationCode) {
    this.fatherInvitationCode = fatherInvitationCode;
  }


  @Basic
  @Column(name = "sign", nullable = false, length = 2)
  public String getSign() {
    return sign;
  }

  public void setSign(String sign) {
    this.sign = sign;
  }


  @Basic
  @Column(name = "registerTime", nullable = false, length = -1)
  public String getRegisterTime() {
    return registerTime;
  }

  public void setRegisterTime(String registerTime) {
    this.registerTime = registerTime;
  }


  @Basic
  @Column(name = "signTime", nullable = false, length = -1)
  public String getSignTime() {
    return signTime;
  }

  public void setSignTime(String signTime) {
    this.signTime = signTime;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    MgtUserInfo that = (MgtUserInfo) o;
    return id == that.id &&
            number == that.number &&
            invitationCode == that.invitationCode &&
            fatherInvitationCode == that.fatherInvitationCode &&
            Objects.equals(username, that.username) &&
            Objects.equals(password, that.password) &&
            Objects.equals(sign, that.sign) &&
            Objects.equals(registerTime, that.registerTime) &&
            Objects.equals(signTime, that.signTime);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, username, password, number, invitationCode, fatherInvitationCode, sign, registerTime, signTime);
  }
}
